package com.ddl.common.enums;

/**
 * @author junqiang.wang
 * @ClassName ResultType
 * @Description BannerType
 * @Company: www.eloancn.com
 * @date 2016/9/21 15:08
 */

public enum BannerType {
    /**
     * 0 首页banner
     * 1 发现页 banner
     * 2 媒体咨询
     * 3 热门活动
     * 4 首页弹框
     *
     */

    BANNER(0,"banner"),
    DISCOVERY(1,"发现页"),
    INFOSLIP(2,"媒体咨询"),
    DYNAMIC(3,"热门活动"),
    ACTIVITY(4,"首页弹窗"),
    SHARE(6,"好友分享")
    ;
    private Integer code;
    private String msg;

    BannerType(Integer code, String msg) {
        this.code=code;
        this.msg=msg;
    }

    public Integer getCode() {
        return code;
    }

    public void setCode(Integer code) {
        this.code = code;
    }

    public String getMsg() {
        return msg;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }

    public static BannerType getBannerType(Integer code) {
        for (BannerType t : BannerType.values()) {
            if (code.equals(t.getCode())) {
                return t;
            }
        }
        return null;
    }
}
